<template>
  <tool-page title="生成随机姓名" @generate="generate" :value="value.surname.name + value.givenName" :remark="remark" @copy="onCopy">
    <template #value>
      <ruby>{{ value.surname.name }}
        <rt style="transform: translateY(-4px)">{{ value.surname.pinyin }}</rt>
      </ruby>
      <ruby>{{ value.givenName }}</ruby>
    </template>
  </tool-page>
</template>

<script>

export default {
  name: "RandFullName",
  data() {
    return {
      value: '',
      remark: '随机生成姓名'
    }
  },
  methods: {
    generate() {
      this.value = this.simpleUtils.randomFullNameObject();
    },
    onCopy() {
      this.$Copy({
        text: this.value.surname.name + this.value.givenName
      })
    }
  },
  created() {
    this.generate();
  }
}
</script>

<style scoped>

</style>
